import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { UserService } from './user.service';
import { AuthMiddleware } from './middleware/auth.middleware';
import { LoginController } from './controller/auth/login.controller';
import { AddProfileController } from './controller/profile/addprofile.controller';
import { GetProfileController } from './controller/profile/getprofile.controller';

@Module({
  controllers: [LoginController, AddProfileController, GetProfileController],
  providers: [UserService],
})
export class UserModule implements NestModule {
  configure(consumer: MiddlewareConsumer) {
    consumer
      .apply(AuthMiddleware)
      .forRoutes(
        'user/profile/one',
        'user/profile/item',
        'clock/*',
        'dynamic/*',
        'award/*',
        'rankling-list/*',
      );
  }
}
